Optimal. Leaf size=149 \[ \frac{a d^2 \cos (e+f x) (d \csc (e+f x))^{n-2} \, _2F_1\left (\frac{1}{2},\frac{2-n}{2};\frac{4-n}{2};\sin ^2(e+f x)\right )}{f (2-n) \sqrt{\cos ^2(e+f x)}}+\frac{a d \cos (e+f x) (d \csc (e+f x))^{n-1} \, _2F_1\left (\frac{1}{2},\frac{1-n}{2};\frac{3-n}{2};\sin ^2(e+f x)\right )}{f (1-n) \sqrt{\cos ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.149725, antiderivative size = 149, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3238, 3787, 3772, 2643} \[ \frac{a d^2 \cos (e+f x) (d \csc (e+f x))^{n-2} \, _2F_1\left (\frac{1}{2},\frac{2-n}{2};\frac{4-n}{2};\sin ^2(e+f x)\right )}{f (2-n) \sqrt{\cos ^2(e+f x)}}+\frac{a d \cos (e+f x) (d \csc (e+f x))^{n-1} \, _2F_1\left (\frac{1}{2},\frac{1-n}{2};\frac{3-n}{2};\sin ^2(e+f x)\right )}{f (1-n) \sqrt{\cos ^2(e+f x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3238
Rule 3787
Rule 3772
Rule 2643
Rubi steps
\begin{align*} \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx &=d \int (d \csc (e+f x))^{-1+n} (a+a \csc (e+f x)) \, dx\\ &=a \int (d \csc (e+f x))^n \, dx+(a d) \int (d \csc (e+f x))^{-1+n} \, dx\\ &=\left (a (d \csc (e+f x))^n \left (\frac{\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac{\sin (e+f x)}{d}\right )^{-n} \, dx+\left (a d (d \csc (e+f x))^n \left (\frac{\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac{\sin (e+f x)}{d}\right )^{1-n} \, dx\\ &=\frac{a \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{1-n}{2};\frac{3-n}{2};\sin ^2(e+f x)\right ) \sin (e+f x)}{f (1-n) \sqrt{\cos ^2(e+f x)}}+\frac{a \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{2-n}{2};\frac{4-n}{2};\sin ^2(e+f x)\right ) \sin ^2(e+f x)}{f (2-n) \sqrt{\cos ^2(e+f x)}}\\ \end{align*}
Mathematica [C] time = 1.64396, size = 280, normalized size = 1.88 \[ \frac{a 2^{n-1} \left (-1+e^{2 i (e+f x)}\right ) e^{-i (e+f n x)} \left (\frac{i e^{i (e+f x)}}{-1+e^{2 i (e+f x)}}\right )^n (\csc (e+f x)+1) \left (e^{i e} (n-1) \left (n e^{i (e+f (n+1) x)} \, _2F_1\left (1,\frac{3-n}{2};\frac{n+3}{2};e^{2 i (e+f x)}\right )+2 i (n+1) e^{i f n x} \, _2F_1\left (1,1-\frac{n}{2};\frac{n+2}{2};e^{2 i (e+f x)}\right )\right )-n (n+1) e^{i f (n-1) x} \, _2F_1\left (1,\frac{1-n}{2};\frac{n+1}{2};e^{2 i (e+f x)}\right )\right ) \csc ^{-n-1}(e+f x) (d \csc (e+f x))^n}{f (n-1) n (n+1) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^2} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.033, size = 0, normalized size = 0. \begin{align*} \int \left ( d\csc \left ( fx+e \right ) \right ) ^{n} \left ( a+a\sin \left ( fx+e \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a \left (\int \left (d \csc{\left (e + f x \right )}\right )^{n}\, dx + \int \left (d \csc{\left (e + f x \right )}\right )^{n} \sin{\left (e + f x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]